{template header.html}
<script type="text/javascript">
    $(function() {
        dr_set_type(0);
    });
    function dr_set_type(id) {
        {loop $ci->app $i $n}
        $('.dr_app_{$i}').hide();
        {/loop}
        $('.dr_app_'+id).show();
    }
    function dr_save_add_data() {
        $.ajax({
            type: "POST",
            dataType:"json",
            url: '{dr_url("syscontroller/add")}&post=1',
            data: $("#myform").serialize(),
            success: function(data) {
                if (data.status == 1) {
                    dr_tips(data.code, 3, 1);
                   window.location.href = "{dr_url('syscontroller/edit')}&id="+data.id;
                } else {
                    dr_tips(data.code);
                    return;
                }
            },
            error: function(HttpRequest, ajaxOptions, thrownError) { }
        });
    }
</script>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        {$menu}
    </div>
    <div class="bk10"></div>
    <div class="table-list col-tab">
        <ul class="tabBut cu-li">
            <li class="on">{lang('397')}</li>
        </ul>
        <div class="contentList pad-10">
            <form action="" method="post" id="myform" name="myform">
                <table width="100%" class="table_form">
                    <tr>
                        <th width="200"><font color="red">*</font>&nbsp;{lang('html-026')}： </th>
                        <td>
                            <input onblur="d_topinyin('cname','name');" id="dr_name" type="text" required style="width:180px;" value="{$data.name}" name="data[name]" class="input-text" />
                            <div class="onShow">{lang('html-027')}</div>
                        </td>
                    </tr>
                    <tr>
                        <th><font color="red">*</font>&nbsp;{lang('396')}： </th>
                        <td>
                            <input type="text" required style="width:180px;" id="dr_cname" value="{$data.cname}" name="data[cname]" class="input-text" />
                            <div class="onShow">{lang('html-187')}</div>
                        </td>
                    </tr>

                    <tr>
                        <th><font color="red">*</font>&nbsp;{lang('html-028')}：</th>
                        <td>
                            {loop $ci->app $i $n}
                            <input type="radio" name="app" onclick="dr_set_type({$i})" value="{$i}" {if $i == 0}checked{/if} />&nbsp;<label>{$n}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                            {/loop}
                        </td>
                    </tr>
                    <tr class="dr_app_0" style="display: none">
                        <th><font color="red">*</font>&nbsp;{lang('html-659')}：</th>
                        <td>
                            <input type="radio" name="data[type][0]" value="0" />&nbsp;<label>{lang('032')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="data[type][0]" value="2" />&nbsp;<label>{lang('260')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr class="dr_app_1" style="display: none">
                        <th><font color="red">*</font>&nbsp;{lang('html-659')}：</th>
                        <td>
                            <input type="radio" name="data[type][1]" value="1" />&nbsp;<label>{lang('m-268')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="data[type][1]" value="2" />&nbsp;<label>{lang('260')}</label>&nbsp;&nbsp;&nbsp;&nbsp;

                        </td>
                    </tr>
                    <tr class="dr_app_2" style="display: none">
                        <th><font color="red">*</font>&nbsp;{lang('html-010')}：</th>
                        <td>
                            {loop $dir $n}
                            <input type="radio" id="dir" name="dir" value="{$n}" />&nbsp;<label>{$n}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                            {/loop}
                        </td>
                    </tr>
                    <tr class="dr_app_2" style="display: none">
                        <th><font color="red">*</font>&nbsp;{lang('html-659')}：</th>
                        <td>
                            <input type="radio" name="data[type][2]" value="0" />&nbsp;<label>{lang('032')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="data[type][2]" value="1" />&nbsp;<label>{lang('m-268')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="data[type][2]" value="2" />&nbsp;<label>{lang('260')}</label>&nbsp;&nbsp;&nbsp;&nbsp;

                        </td>
                    </tr>
                    <tr>
                        <th>{lang('html-103')}：</th>
                        <td>
                            <input class="input-text" type="text" name="data[meta_title]" value="{$data['meta_title']}" size="50" />
                        </td>
                    </tr>
                    <tr>
                        <th>{lang('html-104')}：</th>
                        <td>
                            <input class="input-text" type="text" name="data[meta_keywords]" value="{$data['meta_keywords']}" size="50" />
                        </td>
                    </tr>
                    <tr>
                        <th>{lang('html-105')}：</th>
                        <td>
                            <input class="input-text" type="text" name="data[meta_description]" value="{$data['meta_description']}" size="80" />
                        </td>
                    </tr>

                    <tr>
                        <th> </th>
                        <td><input value="{lang('submit')}" onclick="dr_save_add_data()" type="button" name="submit" class="button" />
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
{template footer.html}